package com.bookstore.service;

import java.util.List;

import com.bookstore.dao.DAOFactory;
import com.bookstore.dao.ReceiverAddressDAO;
import com.bookstore.model.ReceiverAddress;

public class ReceiverAddressServiceImpl implements ReceiverAddressService {

	@Override
	public ReceiverAddress findById(int id) throws Exception {
		ReceiverAddressDAO receiverAddressDAO = DAOFactory.getReceiverAddressDAO();
		return receiverAddressDAO.findById(id);
	}

	@Override
	public void save(ReceiverAddress receiverAddress) throws Exception {
		ReceiverAddressDAO receiverAddressDAO = DAOFactory.getReceiverAddressDAO();
		receiverAddressDAO.save(receiverAddress);
	}

	@Override
	public List<ReceiverAddress> findByUserId(int userId) throws Exception {
		ReceiverAddressDAO receiverAddressDAO = DAOFactory.getReceiverAddressDAO();
		return receiverAddressDAO.findByUserId(userId);
	}

}
